package com.ruoyi.project.system.teacher.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.teacher.mapper.ZzTeacherMapper;
import com.ruoyi.project.system.teacher.domain.ZzTeacher;
import com.ruoyi.project.system.teacher.service.IZzTeacherService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 老师信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-04-29
 */
@Service
public class ZzTeacherServiceImpl implements IZzTeacherService 
{
    @Autowired
    private ZzTeacherMapper zzTeacherMapper;

    /**
     * 查询老师信息
     * 
     * @param id 老师信息ID
     * @return 老师信息
     */
    @Override
    public ZzTeacher selectZzTeacherById(Integer id)
    {
        return zzTeacherMapper.selectZzTeacherById(id);
    }

    /**
     * 查询老师信息列表
     * 
     * @param zzTeacher 老师信息
     * @return 老师信息
     */
    @Override
    public List<ZzTeacher> selectZzTeacherList(ZzTeacher zzTeacher)
    {
        return zzTeacherMapper.selectZzTeacherList(zzTeacher);
    }

    /**
     * 新增老师信息
     * 
     * @param zzTeacher 老师信息
     * @return 结果
     */
    @Override
    public int insertZzTeacher(ZzTeacher zzTeacher)
    {
        zzTeacher.setCreateTime(DateUtils.getNowDate());
        return zzTeacherMapper.insertZzTeacher(zzTeacher);
    }

    /**
     * 修改老师信息
     * 
     * @param zzTeacher 老师信息
     * @return 结果
     */
    @Override
    public int updateZzTeacher(ZzTeacher zzTeacher)
    {
        zzTeacher.setUpdateTime(DateUtils.getNowDate());
        return zzTeacherMapper.updateZzTeacher(zzTeacher);
    }

    /**
     * 删除老师信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZzTeacherByIds(String ids)
    {
        return zzTeacherMapper.deleteZzTeacherByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除老师信息信息
     * 
     * @param id 老师信息ID
     * @return 结果
     */
    @Override
    public int deleteZzTeacherById(Integer id)
    {
        return zzTeacherMapper.deleteZzTeacherById(id);
    }
}
